<?php
/**
 * Created by PhpStorm.
 * User: vanity
 * Date: 2017/5/4
 * Time: 14:30
 */

namespace App\Services;

use Illuminate\Support\Facades\DB;

class articleService
{
    public function getHotArticleMenu()
    {
        $article = DB::table('article')->limit(5)->orderby('read_num','DESC')->get();
        $html = '<ul class="nav nav-pills nav-stacked">';
        foreach($article as $value){
            $html .='<li role="presentation"><a href="'.route('article', ['id' => $value->id]).'">'.$value->title.'</a></li>';
        }
        $html .='</ul>';
        return $html;
    }
}
